<%@ page import="com.jsmtr.rms.utils.RightInterceptor" %>
<%@ page import="com.jsmtr.rms.entity.BaseUser" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="../../../include/admincontent.jsp" %>
<% String basepaths = request.getContextPath(); %>
<%  BaseUser baseUser= (BaseUser) request.getSession().getAttribute(RightInterceptor.SEESION_MEMBER);%>
<div id="Content"   style="min-width: 1920px">
<%--    <div class="btnbar">
        <button type="button" class="save" id="resume_ok">通过</button>
        <button type="button" class="del" id="resume_no">未通过</button>
        <button type="button" class="del" id="resume_reset">重置</button>
        <% if(baseUser.getUdept().equalsIgnoreCase("00006")){ %>
        <button type="button" class="card" id="gxpublishresult" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</button>
        <button type="button" class="list" id="resume_next">进入下一步</button>
        <button type="button" class="list" id="resume_sendmsg">短信通知</button>
        &lt;%&ndash;<button type="button" class="save" id="resumeCheck_ok">批量通过筛选</button>&ndash;%&gt;
        <button type="button" class="del" id="resumeCheck_no">批量未通过</button>
        &lt;%&ndash;<button type="button" class="del" id="repetition_clear">重复简历筛选</button>&ndash;%&gt;
       &lt;%&ndash; <button type="button" class="del" id="resume_show">流程查询</button>&ndash;%&gt;
        <button type="button" class="save" id="resume_output">导出</button>
        <button type="button" class="save" id="resume_input">导入</button>
        <button type="button" class="list" id="do_tjgw" pid="${pid}" fid="${fid}" deptcode="${deptcode}">转岗
        </button>
        <button type="button" class="list" id="do_gwpp" pid="${pid}" fid="${fid}" deptcode="${deptcode}">岗位匹配</button>
        <button type="button" class="save" id="resume_down">下载简历</button>
        <% }else{ %>
        <button type="button" class="del" id="resumeCheck_no">批量未通过筛选</button>
        <%}%>
        &lt;%&ndash;<button type="button" class="back" onclick="javascript:history.go(-1);">返回</button>&ndash;%&gt;
    </div>--%>

    <div class="toolbars" style="height:30px;white-space:nowrap;width:auto;margin-left: 10px;" totalwidth="314">
        <a id="resume_ok">
            <em class="ico16 gone_through_16"></em>
            <span class="menu_span" title="通过">通过</span>
        </a>
        <a id="resume_no" style="margin-left: 5px">
            <em  class="ico16 stop_contract_16"></em>
            <span  class="menu_span" title="未通过">未通过</span>
        </a>
        <a id="resume_reset" style="margin-left: 5px">
            <em  class="ico16 share_xls_32"></em>
            <span  class="menu_span" title="重置">重置</span>
        </a>
        <% if(baseUser.getUdept().equalsIgnoreCase("00006")){ %>
        <a id="gxpublishresult" style="margin-left: 5px">
            <em  class="ico16 plan_16"></em>
            <span  class="menu_span" title="公布/屏蔽结果" fid="${fid}" deptcode="${deptcode}">公布/屏蔽结果</span>
        </a>
        <a id="resume_next" style="margin-left: 5px">
            <em  class="ico16 more_blue"></em>
            <span  class="menu_span" title="进入下一步">进入下一步</span>
        </a>
        <a id="resume_sendmsg" style="margin-left: 5px">
            <em  class="ico16 common_language_16"></em>
            <span  class="menu_span" title="发短信">发短信</span>
        </a>
        <a id="resumeCheck_no" style="margin-left: 5px">
            <em  class="ico16 hover_close_16"></em>
            <span  class="menu_span" title="批量未通过">批量未通过</span>
        </a>
        <a id="resume_output" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_down"></em>
            <span  class="menu_span" title="导出">导出</span>
        </a>
        <a id="resume_input" style="margin-left: 5px">
            <em  class="ico16 behavioranalysis_up"></em>
            <span  class="menu_span" title="导入">导入</span>
        </a>
        <a id="do_tjgwNew" style="margin-left: 5px">
            <em  class="ico16 check_level_16"></em>
            <span  class="menu_span" title="转岗"  pid="${pid}" fid="${fid}" deptcode="${deptcode}">转岗</span>
        </a>
        <a id="do_gwpp" style="margin-left: 5px">
            <em  class="ico16 mapping_16"></em>
            <span  class="menu_span" title="岗位匹配" pid="${pid}" fid="${fid}" deptcode="${deptcode}">岗位匹配</span>
        </a>
        <% }else{ %>
        <a id="resumeCheck_no" style="margin-left: 5px">
            <em  class="ico16 online3"></em>
            <span  class="menu_span" title="批量未通过筛选">批量未通过筛选</span>
        </a>
        <%}%>
        <a id="resume_down_zip" style="margin-left: 5px">
            <em  class="ico16 download_online_16"></em>
            <span  class="menu_span" title="下载简历">下载简历</span>
        </a>
        <a id="send_news" style="margin-left: 5px">
            <em  class="ico16 info_16"></em>
            <span  class="menu_span" title="消息通知">消息通知</span>
        </a>
    </div>

    <!-- 消息通知 -->
    <div id="infospanel"  class="condition_cont">
        <form id="infosform" method="post" action="/Do/SendInfos/SendInfosAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}">
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="100">消息内容:</td>
                    <td width="500">
                        <div><textarea name="infoContent" datatype="*" nullmsg="消息内容不能为空！"></textarea></div>
                    </td>
                    <td></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                        <button type="submit" class="op">发送消息通知</button>
                    </td>
                    <td></td>
                </tr>
                </thead>
            </table>
            <div id="infosuers"></div>
            <div id="infosuerCardnos"></div>
        </form>
    </div>

    <div id="searchbox">
        <form id="sform">
            <input type="hidden" name="proid" value="${pid}"/>
            <input type="hidden" name="path" value="${fid}"/>
            <input type="hidden" name="rcount" id="checkrount" value=""/>
            <table class="treeTable searchform">
                <thead>
                <tr>
                    <td width="60">应聘岗位:</td>
                    <td >
                        <div>
                           <%-- <input type="text" name="jname"/>--%>

                            <select name="jname">
                            <option value="">请选择</option>
                            <c:forEach var="projectinfojobs" items="${jobs}" varStatus="item" >
                                <c:choose>
                                    <c:when test="${projectinfojobs!=null}">
                                        <option value="${projectinfojobs.jobname}">${projectinfojobs.jobname}</option>
                                    </c:when>

                                </c:choose>
                            </c:forEach>
                            </select>
                        </div>
                    </td>


                    <td width="60">应聘部门:</td>
                    <td>
                        <div>
                            <%--<input type="text" name="jobdepart"/>--%>
                            <select name="jobdepart">
                                <option value="">全部</option>
                                <option value="办公室">办公室</option>
                                <option value="党群文宣部、研究室">党群文宣部、研究室</option>
                                <option value="纪检监察室">纪检监察室</option>
                                <option value="组织人事部、人力资源部">组织人事部、人力资源部</option>
                                <option value="审计法务部、监事会办公室">审计法务部、监事会办公室</option>
                                <option value="财务管理部">财务管理部</option>
                                <option value="战略企管部">战略企管部</option>
                                <option value="安全运营部">安全运营部</option>
                                <option value="建设管理部">建设管理部</option>
                                <option value="总工办">总工办</option>
                                <option value="科技信息部">科技信息部</option>
                                <option value="直属党委">直属党委</option>
                            </select>
                        </div>
                    </td>
                    <td width="60">下属企业:</td>
                    <td >
                        <div>
                            <input type="text" name="wkcompanyname"/>
                        </div>
                    </td>
                    <td width="60">工作部门:</td>
                    <td >
                        <div>
                            <input type="text" name="wkdepartment"/>

                        </div>
                    </td>
                    <td >工作岗位:</td>
                    <td>
                        <div><input type="text" name="wkposition"/></div>
                    </td>
                </tr>
                <tr>

                    <td>简历状态:</td>
                    <td >
                        <div> <select name="state">
                            <option value="">不限</option>
                            <option value="未处理">未处理</option>
                            <option value="已通过">已通过</option>
                            <option value="未通过">未通过</option>
                        </select></div>
                    </td>
                    <td>最高学历:</td>
                    <td >
                        <div><select name="education">
                            <option value="-1">不限</option>
                            ${education}</select></div>
                    </td>
                    <td width="60">姓名:</td>
                    <td>
                        <div><input type="text" name="name"/></div>
                    </td>
                    <td width="60">身份证号:</td>
                    <td>
                        <div><input type="text" name="cardno"/></div>
                    </td>
                    <td>联系电话:</td>
                    <td>
                        <div>
                            <input type="text" name="tel"/>
                        </div>
                    </td>
                    <%--<td>意向地点:</td>
                    <td >
                        <div>
                            <input type="text" name="presentsalaryamount"/>
                        </div>
                    </td>--%>
                </tr>
                <tr class="moretj">
                    <td width="60">投递时间:</td>
                    <td width="150">
                            <div><input type="text" name="adddate" class="select"
                                        onFocus="blur()" onclick="laydate({molv: true,format:'YYYY-MM-DD hh:mm'})"></div>

                         <%--   <div class="layui-inline" style="width: 100%;" >
                                <div class="layui-input-inline" style="width: 100%;">
                                    <input class="layui-input" name="adddate" onFocus="blur()"
                                           style="width: 100%;height: 24px" id="tdTime" type="text">
                                </div>
                            </div>--%>
                    </td>
                   <%-- <td width="16" style="text-align:center;">至</td>
                    <td width="60">
                        <div><input type="text" name="ageto"/></div>
                    </td>--%>
                    <%--<td width="60" style="text-align:right;">身高:</td>
                    <td width="160">
                        <div><input type="text" name="heightfrom" style="max-width: 40%"/>至<input type="text" name="heightto" style="max-width: 40%"/></div>
                    </td>--%>

                  <%--  <td width="36" style="text-align:center;">至</td>
                    <td width="50">
                        <div></div>
                    </td>--%>
                    <td width="60" style="text-align:right;">投递区段:</td>
                    <td width="160">
                       <div><input type="text" name="adddatefrom" class="select"
                                         onFocus="blur()" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"/></div>

      <%--                  <div class="layui-inline" style="width: 100%;" >
                            <div class="layui-input-inline" style="width: 100%;">
                                <input class="layui-input" name="adddatefrom" onFocus="blur()"
                                       style="width: 100%;height: 24px" id="tdTimef" type="text">
                            </div>
                        </div>--%>
                    </td>
                    <td width="20">至</td>
                    <td width="160">
                        <div>
                            <input type="text" name="adddateto" class="select"
                                   onFocus="blur()" onclick="laydate({istime: true,format:'YYYY-MM-DD hh:mm'})"/>
                        </div>

<%--                        <div class="layui-inline" style="width: 100%;" >
                            <div class="layui-input-inline" style="width: 100%;">
                                <input class="layui-input" name="adddateto" onFocus="blur()"
                                       style="width: 100%;height: 24px" id="tdTimet" type="text">
                            </div>
                        </div>
                    </td>--%>
                    <td width="60">政治面貌:</td>
                    <td width="150">
                        <div><select name="zzmmcode">
                            <option value="">不限</option>
                            ${zzmm}</select></div>
                    </td>
                    <td width="60" style="text-align:right;">年龄:</td>
                    <td width="160">
                        <div><input type="text" name="agefrom" style="max-width: 40%"/>至<input type="text" name="ageto" style="max-width: 40%"/></div>
                    </td>
                    <%--<td width="60">性别:</td>
                    <td>
                        <div>
                            <select name="sexname">
                                <option value="">不限</option>
                                <option value="男">男</option>
                                <option value="女">女</option>
                            </select>
                        </div>
                    </td>--%>
                </tr>
                <tr class="moretj">
                    <td>短信发送:</td>
                    <td>
                        <div>
                            <select name="bdremark">
                                <option value="">全部</option>
                                <option value="已发送">已发送</option>
                                <option value="未发送">未发送</option>
                                <option value="发送失败">发送失败</option>
                            </select>
                        </div>
                    </td>
                    <td>是否发布:</td>
                    <td>
                        <div><select name="op1">
                            <option value="">全部</option>
                            <option value="已公布">已公布</option>
                            <option value="未公布">未公布</option>
                        </select></div>
                    </td>
                    <td>是否放弃:</td>
                    <td>
                        <div>
                            <select name="fqstate">
                                <option value="">全部</option>
                                <option value="未放弃" selected>未放弃</option>
                                <option value="已放弃">已放弃</option>
                            </select>
                        </div>
                    </td>
                    <td>个人情况:</td>
                    <td >
                        <div> <select name="usercontent">
                            <option value="">全部</option>
                            <option value="已记录">已记录</option>
                            <option value="未记录">未记录</option>
                        </select></div>
                    </td>
                   <%-- <td width="60">是否转岗:</td>
                    <td width="100">
                        <div>
                            <select name="ischangejob">
                                <option value="">全部</option>
                                <option value="是">是</option>
                                <option value="否">否</option>
                            </select>
                        </div>
                    </td>--%>
                    <td width="60" style="text-align:right;">备注:</td>
                    <td width="100">
                        <div><input type="text" name="sxbz" /></div>
                    </td>
                </tr>

                <tr>
                    <td colspan="2">
                    <%--   <div style="padding-top: 8px;"> <button id="searchbtn" type="button" class="search"></button>
                           <button id="clearbtn" type="reset" class="del" title="清除" style="flex: 1;margin-left: 5px;"></button>
                       </div>--%>
                        <div class="toolbars">
                            <a id="searchbtn">
                                <em class="ico16 search_16"></em>
                                <span >查询</span>
                            </a>
                            <a id="clearbtn">
                                <em class="ico16 refresh_16"></em>
                                <span>清除</span>
                            </a>
                        </div>
                    </td>
                    <td colspan="8">
                       <%-- <button id="showhidebtn" type="button" class="moretjbtn0" onclick="moreparam()"
                                title="高级查询"></button>--%>
                           <div class="toolbars">
                               <a onclick="moreparam()">
                                   <em class="ico16 search_disable_16"></em>
                                   <span >高级查询</span>
                               </a>
                           </div>
                    </td>
                </tr>
                </thead>
            </table>
        </form>
    </div>

    <%--<div id="page_top" class="page"></div>

    <table class="treeTable" id="tablelist">
        <thead>
        <tr>
            <td width="20"><input type="checkbox" class="allcheckbox" title="选择全部/取消全选"/></td>
            <td width="30">序号</td>
           &lt;%&ndash; <td width="60">简历编号</td>&ndash;%&gt;
            <td width="110">姓名</td>
            <td width="120">身份证号</td>
            <td width="30">性别</td>
&lt;%&ndash;            <td width="220">所属企业</td>
            <td width="120">工作部门</td>
            <td width="70">工作岗位</td>
            <td width="80">截止时间</td>&ndash;%&gt;
            <td width="70">应聘部门</td>
            <td width="70">应聘岗位</td>
            <td width="70">应聘时间</td>
            <td width="70">学历</td>
            <td width="30">年龄</td>
            <!-- <td width="60">生源地</td> -->
            <td width="55">政治面貌</td>
            <td width="75">联系电话</td>
            <td width="70">短信状态</td>
            <td width="50">简历状态</td>
            <td width="80">备注</td>
            &lt;%&ndash;<td width="80">最近登录</td>&ndash;%&gt;
            <td width="80">个人情况</td>
            <td width="50">公布结果</td>
            <td width="50"></td>
        </tr>
        </thead>
        <tbody id="result"></tbody>
    </table>
    <div id="page_bottom" class="page"></div>--%>

    <table class="layui-hide" id="tablelistGxResume" lay-filter="listTables"></table>
<%--<div id="menu" style="display: none"><span>hhhhhhh</span></div>--%>
</div>
<%--<script src="../../../resources/js/plugins/layui/layui.all.js" type="text/javascript"></script>--%>
<script type="text/javascript">
    $("#searchbox").width($(window).width()-10);
    var nowflow="${nowflow}";

    var pageobj = null;
    var ptypes = "GXResume";

/*
    layui.use('laydate', function(){
        var laydate = layui.laydate;

        laydate.render({
            elem: '#tdTime'  ,
         //   type: 'datetime',
            format: 'yyyy-MM-dd HH:mm'
        });

        laydate.render({
            elem: '#tdTimef'  ,
            //   type: 'datetime',
            format: 'yyyy-MM-dd HH:mm'
        });

        laydate.render({
            elem: '#tdTimet'  ,
            //   type: 'datetime',
            format: 'yyyy-MM-dd HH:mm'
        });
    });
*/

   // getList();
    $(document).ready(function () {

        //查看向哪些方案投过简历
        $(document).delegate('#tablelist tbody .mopen', 'click', function () {
            openpLayer('查看', '/Do/GXResume/hisresume?code=' + $(this).find('span').text(), '500px', '400px');
        });

    });



/*    $('#searchbtn').click(function () {
        getList();
    });*/
 /*   $('#searchbtn').on('click',function () {
       /!* $('#tjusers').html('');
        $('#msgusers').html('');
        $('#rusers').html('');*!/
    //    getList();
    });*/

    $('#clearbtn').on('click',function () {
        document.getElementById("sform").reset();
    });

    //消息通知
    $('#send_news').on('click',function () {
        getTableChecks();

        $('#infospanel').slideToggle(300);
        $(this).toggleClass('cur').blur().siblings().removeClass('cur');
    });

    var selectDataTemp = [];
    function getTableChecks(){
        var selectData = layui.table.checkStatus('listTables').data;

        if(selectDataTemp.length > 0){
            for(var i=0;i<selectDataTemp.length;i++){
                $('#infosuers input').each(function () {
                    if ($(this).val() == selectDataTemp[i].id_cb.replace('cb_', ''))
                        $(this).remove();
                });
                $('#infosuerCardnos input').each(function () {
                    if ($(this).val() == selectDataTemp[i].CARDNO)
                        $(this).remove();
                });
            }
        }
        if(selectData.length == 0){
            selectDataTemp = selectData;
        }else{
            for(var i=0;i<selectData.length;i++){
                $('#infosuers').append('<input type="hidden" name="id" value="' + selectData[i].id_cb.replace('cb_', '') + '"/>');
                $('#infosuerCardnos').append('<input type="hidden" name="cardno" value="' + selectData[i].CARDNO + '"/>');
            }
            selectDataTemp = selectData;
        }
    }

    $('#resume_ok').click(function () {
        var url = '/Do/GXResume/ResumeOkAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
     //   cgMoreData1(url);

        var id = '';
        var selectData = layui.table.checkStatus('listTables').data;
        if(selectData.length == 0){
            parent.layer.alert('请选择要执行该操作的信息!', {icon: 2});
        }else{
            for(var i=0;i<selectData.length;i++){
                id += 'id=' + selectData[i].id_cb.replace('cb_', '') + '&';
            }
            postAjax(url, id, function (data) {
                if (data.state) {
                    parent.layer.alert(data.Message, {icon: 1, time: 2000});
                    tableRenders();
                } else {
                    parent.layer.alert(data.Message, {icon: 2, time: 2000});
                }
            });
        }
    });

    $('#resume_no').click(function () {
        var id = '';
        var selectData = layui.table.checkStatus('listTables').data;
        if(selectData.length == 0){
            parent.layer.alert('请选择一条信息!', {icon: 2});
        }else if(selectData.length  > 1){
            parent.layer.alert('只能选择一条信息!', {icon: 2});
        }else{
            id = 'id=' + selectData[0].id_cb.replace('cb_', '') ;
            openpLayer('简历筛选未通过', '/Do/GXResume/bz?id=' + id + '&pid=${pid}&fid=${fid}&deptcode=${deptcode}', '500px', '200px');
        }
    });

    $('#resume_reset').click(function () {
        var ids = '';
        var selectData = layui.table.checkStatus('listTables').data;
        if(selectData.length == 0){
            parent.layer.alert('请选择一条信息!', {icon: 2});
        }else{
            for(var i=0;i<selectData.length;i++){
                ids += selectData[i].id_cb.replace('cb_', '') + ',';
            }
            parent.layer.confirm('重置后该应聘者状态变为未处理。<br>确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                var url = '/DUserResume/ResetAction';
                postAjax(url, {pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",ids:ids}, function (data) {
                    if (data.state) {
                        parent.layer.alert(data.Message, {icon: 1,time:5000});
                        tableRenders();
                        var Timer = setTimeout(changeToNextTab(nowflow),500);
                        clearTimeout(1);
                    }
                    else {
                        parent.layer.alert(data.Message, {icon: 2,time:5000});
                    }
                });
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });
        }
    });


    $('#resume_sendmsg').click(function () {
        var ids = '';
        var selectData = layui.table.checkStatus('listTables').data;
        if(selectData.length == 0){
            parent.layer.alert('请选择一条信息!', {icon: 2});
        }else{
            for(var i=0;i<selectData.length;i++){
                ids += selectData[i].id_cb.replace('cb_', '') + ',';
            }
            parent.layer.confirm('将会对已发布信息发送短信。<br>确定要执行吗？', {
                btn: ['是', '否']
            }, function () {
                var url = '/DUserResume/SendMessageAction';
                postAjax(url, {pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",ids:ids}, function (data) {
                    if (data.state) {
                        parent.layer.alert(data.Message, {icon: 1,time:5000});
                        tableRenders();
                        var Timer = setTimeout(changeToNextTab(nowflow),500);
                        clearTimeout(1);
                    }
                    else {
                        parent.layer.alert(data.Message, {icon: 2,time:5000});
                    }
                });
                parent.layer.closeAll();
            }, function () {
                parent.layer.closeAll();
            });

        }
    });

    $('#resumeCheck_no').click(function(){
        var ids = '';
        var selectData = layui.table.checkStatus('listTables').data;
        if(selectData.length == 0){
            parent.layer.alert('至少选择一条信息!', {icon: 2});
        }else{
            for(var i=0;i<selectData.length;i++){
                ids += selectData[i].id_cb.replace('cb_', '') + ',';
            }

            parent.layer.prompt({title: '请填写未通过原因，并确认', formType: 2}, function(text, index){
                parent.layer.close(index);
                $.post("/Do/GXResume/ResumeAllNoAction"
                    ,{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",ids:ids,sxbz:text}
                    ,function (result) {
                        if (result.state) {
                            parent.layer.alert(result.Message, {icon: 1});
                            tableRenders();
                        }
                        else {
                            parent.layer.alert(result.Message, {icon: 2});
                        }
                    }
                    ,"json");
            });
        }
    });
/*
    $('#resume_down').click(function(){
        getTableChecks();
        var id = '';
        var selectData = layui.table.checkStatus('listTables').data;

        if(selectData.length == 0){
            parent.layer.alert("至少选择1条信息！", {icon: 2});
        }if(selectData.length > 10){
            parent.layer.alert("一次最多只能选择10条信息！", {icon: 2});
        }else {
            for(var i=0;i<selectData.length;i++){
                id += 'id=' + selectData[i].id_cb.replace('cb_', '') + '&';
            }
            $.post("/AppendOut/OutputByWord?"+id,function (json) {
                if(json.state){
                    var urls = json.url.split(',');
                    var lens = urls.length-1;
                    for(var i=0;i<lens;i++){
                        if (window.navigator.appName == 'Microsoft Internet Explorer') {  // IE
                            window.open(urls[i], '_blank');
                        } else {
                            let a = document.createElement('a') ;// 创建a标签
                            let e = document.createEvent('MouseEvents'); // 创建鼠标事件对象
                            e.initEvent('click', false, false); // 初始化事件对象
                            a.href = urls[i] ;// 设置下载地址
                            a.download = ''; // 设置下载文件名
                            a.dispatchEvent(e);
                        }
                    }
                    layer.alert(json.Message+"\n已下载"+lens+"份简历。", {icon: 1});
                }else{
                    layer.alert(json.Message, {icon: 2});
                }
            },"json")
        }
    });*/

    $('#resume_next').click(function () {
        parent.layer.confirm('只有通过简历筛选的人员才能执行此操作。<br>确定要执行吗？', {
            btn: ['是', '否']
        }, function () {
            toNextFlowNew('/Do/GXResume/NextAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}','${fid}');
            parent.layer.closeAll();
        }, function () {
            parent.layer.closeAll();
        });
    });
    $('#resume_output').click(function () {
        //openLayer('请选择要导出的字段', '/ExcelDown/DownDoResume?pid=${pid}&fid=${fid}&deptcode=${deptcode}', '60%', '70%');
        openpLayer('请选择要导出的字段', '/ExcelDown/DownDoResume?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '70%');

    });

    $('#resume_input').click(function () {
        openpLayer('Excel数据导入', '/ExcelImport/ImportExcelPage?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+$('#sform').serialize(), '60%', '500px');
    });

   /* $('#repetition_clear').click(function () {
        $('#checkrount').val(1);
       // getList();
        //$('#checkrount').val('');
    });*/
  /*  $('#clearbtn').click(function () {
        $('#checkrount').val('');
        $('#sform')[0].reset();
      //  getList();
    });*/

/*    $('#do_tjgw').click(function () {
      //  var tboj = $(this);
        var id = '';
        var count = 0;
        $('#tablelist tbody input[type=checkbox]').each(function () {
            if ($(this).is(":checked")) {
                count++;
                id += 'id=' + $(this).attr('id').replace('cb_', '') + '&';
            }
        });
        if (count == 0) {
            parent.layer.alert('请选择要执行该操作的信息', {icon: 5,time:5000});
        } else {
           // openpLayer('推荐到其他岗位', '/DUserResume/RecommendPost?pid=' + tboj.attr('pid') + '&fid=' + tboj.attr('fid') + '&deptcode=' + tboj.attr('deptcode') + '&' + id, '60%', '90%');
            openpLayer('推荐到其他岗位', '/DUserResume/RecommendPost?pid=${pid}&fid=${fid}&deptcode=${deptcode}&'+ id, '60%', '60%');
        }
    });*/


    /* $('#do_gxresume_next').click(function(){
        layer.confirm('只有已投简历的信息才能执行此操作。<br>确定要执行吗？', {
            btn: ['是','否']
        }, function(){
            DelInfo('/Do/GXResume/NextAction?pid=${pid}&fid= ${fid}&deptcode= ${deptcode}');
		            layer.closeAll();
		    	}, function(){
		    		layer.closeAll();
		    	});
		    }); */

/*    $('#resumeCheck_ok').click(function(){
        // var checkRows=$('#tablelist tbody input[type=checkbox]:checked');
        var checkRows=$('.allcheckbox').data('checkIds');
        if(!!!checkRows||checkRows.length==0){
            //$.Showmsg('至少选择一条信息');
            parent.layer.alert('至少选择一条信息', {icon: 2});
        }else{
            var ids="";
            $(checkRows).each(function (index,itme) {
                ids+=itme.replace('cb_', '')+",";
            });
            $.post("/Do/GXResume/ResumeAllOkAction",{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",ids:ids},function (result) {
                if (result.state) {
                    parent.layer.alert(result.Message, {icon: 1});
                  //  getList();
                }
                else {
                    parent.layer.alert(result.Message, {icon: 2});
                }
            },"JSON");

        }
    });*/



 /*   function getList() {
        pageobj = $('.page').myPagination({
            cssStyle: "pagination",
            saveChecked:true,
            rowNumber: true,
            showTitle:true,
            contextMenu:true,
            contextMenuParam:{
                menu: [{
                    text: "情况说明",
                    callback: function(ele) {
                        console.log($(this))
                        var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                        var rmarkid=$(ele).find('input[type=hidden]:eq(0)').val();
                        var cardno=ele[0].cells[3].innerText;
                        var rname=ele[0].cells[2].innerText;
                        parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 个人情况说明，并确认', formType: 2}, function(text, index){
                            parent.layer.close(index);
                            var cid=tcid.replace('cb_','');
                            $.post("/SaveUserRemark"
                                ,{id:rmarkid,pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",rid:cid,content:text,rname:rname,cardno:cardno}
                                ,function (result) {
                                    if (result.state) {
                                        $.Showmsg(result.message);
                                        getList();
                                    }
                                    else {
                                        $.Showmsg(result.message);
                                    }
                                }
                                ,"json");
                        });
                    }
                },
                    {
                        text: "通过",
                        callback: function(ele) {
                            var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                            var cardno=ele[0].cells[3].innerText;
                            var rname=ele[0].cells[2].innerText;
                            var cindex=  parent.layer.confirm('姓名:'+rname+"<br/>身份证:"+cardno+'<br/>是否确认通过?<br/>',{icon:3,title:'提示'},function () {
                                var url = '/Do/SZResume/ResumeOkAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
                                var cid=tcid.replace('cb_','');
                                postAjax(url, {id:cid}, function (data) {
                                    if (data.state) {
                                        parent.layer.msg(data.Message,{icon:1,time:2000});
                                        getList();
                                    }
                                    else {
                                        parent.layer.msg(data.Message,{icon:2,time:2000});
                                    }
                                });
                            },function () {
                                layer.close(cindex);
                            });
                        }
                    },
                    {
                        text: "不通过",
                        callback: function(ele) {
                            var tcid=$(ele).find('input[type=checkbox]:eq(0)').attr('id');
                            var cardno=ele[0].cells[3].innerText;
                            var rname=ele[0].cells[2].innerText;
                            parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 未通过原因，并确认', formType: 2}, function(text, index){
                                parent.layer.close(index);
                                var cid=tcid.replace('cb_','');
                                $.post("/Do/SZResume/ResumeNoAction"
                                    ,{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",id:cid,sxbz:text}
                                    ,function (result) {
                                        if (result.state) {
                                            $.Showmsg(result.Message);
                                            getList();
                                        }
                                        else {
                                            $.Showmsg(result.Message);
                                        }
                                    }
                                    ,"json");
                            });
                        }
                    },
                    {
                        text: "查看个人简历",
                        callback: function(ele) {
                            var url=$(ele).find('a').attr('href');
                            if(!!url){
                                window.open(url);
                            }
                        }
                    },
                    {
                        text: "刷新列表",
                        callback: function() {
                            getList()
                        }
                    }
                ]
            },
            ajax: {
                on: true,
                url: '${path}/DUserResume/getusers?flowid=${fid}',
                param: $('#sform').serialize(),
                dataType: 'html',
                callback: function (data) {
                 //var rows= createRowNo(data);
                    $('#result').html(data);
                    parent.changeFrameHeight();
                    $('#result a').click(function () {
                        event.stopPropagation();
                    });
                }
            }
        });
    }*/

   // $(function () {
        fillSelectState("state","${fid}");
  //  })


/*
    function reloadData() {
        pageobj.onReload();
    }*/

    var GxResumesTable;
    var sdat;

   layui.config({
        base: '<%=basepaths%>/resources/js/plugins/ext/',   // 模块目录
        version: 'v1.5.10' // 插件版本号
    }).extend({
        soulTable: 'soulTable',// 模块别名
        tableChild: 'tableChild',
        tableMerge: 'tableMerge',
        tableFilter: 'tableFilter',
       // excel: 'excel',
    });

    layui.use(['table','soulTable','tableChild','tableMerge','tableFilter'], function(){
    var   soulTable = layui.soulTable,
                tableChild = layui.tableChild,
                tableMerge = layui.tableMerge,
                tableFilter = layui.tableFilter,
              $ = layui.$;

            GxResumesTable = layui.table;
            sdat = '${path}/DUserResume/getGxResumeListLayuiJson?flowid=${fid}&'+$('#sform').serialize();

            GxResumesTable.render({
                id:'listTables'
                ,elem: '#tablelistGxResume'
                ,url: sdat
                ,title:'用户数据表'
                , height: 'full'
                //  ,cellMinWidth: 40 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
                ,contextmenu: {
                    // 表格内容右键菜单配置
                    body: [
                        {
                            name: '情况说明', // 显示的菜单名
                            click: function(obj) { //点击事件
                             //   console.log(obj.row) // 当前行数据
                                var tcid = obj.row.id_cb;
                                var rmarkid = obj.cell[0].parentElement.children[3].innerText;
                                var cardno = obj.row.CARDNO;
                                var rname = obj.row.NAME;
                                parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 个人情况说明，并确认', formType: 2}, function(text, index){
                                    parent.layer.close(index);
                                    var cid=tcid.replace('cb_','');
                                    $.post("/SaveUserRemark"
                                        ,{id:rmarkid,pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",rid:cid,content:text,rname:rname,cardno:cardno}
                                        ,function (result) {
                                            if (result.state) {
                                                parent.layer.msg(result.message,{icon:1});
                                                tableRenders();
                                            }
                                            else {
                                                parent.layer.msg(result.message,{icon:2});
                                            }
                                        }
                                        ,"json");
                                });
                            }
                        }
                        ,{
                            name: '通过', // 显示的菜单名
                            click: function(obj) { //点击事件
                                var tcid = obj.row.id_cb;
                                var cardno = obj.row.CARDNO;
                                var rname = obj.row.NAME;

                                var cindex=  parent.layer.confirm('姓名:'+rname+"<br/>身份证:"+cardno+'<br/>是否确认通过?<br/>',{icon:3,title:'提示'},function () {
                                    var url = '/Do/SZResume/ResumeOkAction?pid=${pid}&fid=${fid}&deptcode=${deptcode}';
                                    var cid=tcid.replace('cb_','');
                                    postAjax(url, {id:cid}, function (data) {
                                        if (data.state) {
                                            parent.layer.msg(data.Message,{icon:1});
                                            tableRenders();
                                        }
                                        else {
                                            parent.layer.msg(data.Message,{icon:2});
                                        }
                                    });
                                },function () {
                                    layer.close(cindex);
                                });
                            }
                        }
                        ,{
                            name: '不通过', // 显示的菜单名
                            click: function(obj) { //点击事件
                                var tcid = obj.row.id_cb;
                                var cardno = obj.row.CARDNO;
                                var rname = obj.row.NAME;

                                parent.layer.prompt({title: '请填写姓名:'+rname+' 身份证:'+cardno+' 未通过原因，并确认', formType: 2}, function(text, index){
                                    parent.layer.close(index);
                                    var cid=tcid.replace('cb_','');
                                    $.post("/Do/SZResume/ResumeNoAction"
                                        ,{pid:"${pid}",fid:"${fid}",deptcode:"${deptcode}",id:cid,sxbz:text}
                                        ,function (result) {
                                            if (result.state) {
                                                parent.layer.msg(result.Message,{icon:1});
                                                tableRenders();
                                            }
                                            else {
                                                parent.layer.msg(result.Message,{icon:2});
                                            }
                                        }
                                        ,"json");
                                });
                            }
                        }
                        ,{
                            name: "查看个人简历",// 显示的菜单名
                            click: function(obj) { //点击事件
                                var url = obj.row.ContextPath;
                                if(!!url){
                                    window.open(url);
                                }
                            }
                        }
                        ,{
                            name: "刷新列表",// 显示的菜单名
                            click: function(obj) { //点击事件
                               tableRenders();
                            }
                        }
                    ],
                }
                ,cols: [[
                    {type:'checkbox',fixed:'center'}
                    ,{field:'id', title: '序号', fixed:'center',sort: true,minWidth:80}
                    ,{field:'NAME',title: '姓名', fixed:'left',sort: true,minWidth:100,templet: function(d){
                            if(d.cardcount>1){
                                return '<a target="_blank" href="' + d.ContextPath + '">' +d.NAME+
                                    '</a>&nbsp;<span class="layui-badge">'+d.cardcount+'</span>';
                            }else{
                                return '<a target="_blank" href="' + d.ContextPath + '">' +d.NAME;
                            }
                        }}
                    ,{field:'MID',  title: '', fixed:'center', sort: true,hide:true}
                    ,{field:'CARDNO',title: '身份证号', fixed:'center',minWidth:160}
                    ,{field:'SEXNAME', title: '性别', fixed:'center',minWidth:80}
                    ,{field:'JOBDEPART', title: '应聘部门', fixed:'center',sort: true,minWidth:120}
                    ,{field:'JNAME', title: '应聘岗位', fixed:'center', sort: true,minWidth:130}
                    ,{field:'ADDDATE', title: '应聘时间', fixed:'center', sort: true,minWidth:130}
                    ,{field:'EDUCATIONNAME', title: '学历', fixed:'center', sort: true,minWidth:120}
                    ,{field:'BIRTHDAY',  title: '年龄', fixed:'center', sort: true,minWidth:80}
                    ,{field:'ZZMMNAME',  title: '政治面貌', fixed:'center', sort: true,minWidth:110}
                    ,{field:'TEL',  title: '联系电话', fixed:'center',minWidth:120}
                    ,{field:'stateMsg',  title: '短信状态', fixed:'center', sort: true,minWidth:110}
                    ,{field:'STATE',  title: '简历状态', fixed:'center', sort: true,minWidth:110}
                    ,{field:'SXBZ',  title: '备注', fixed:'center', sort: true,minWidth:130}
                    ,{field:'STATEa',  title: '个人情况', fixed:'center', sort: true,minWidth:110}
                    ,{field:'STATEb',  title: '公布结果', fixed:'center', sort: true,minWidth:110,templet: function(d){
                            if(d.STATEb == "未公布")
                                return '<span class="layui-badge layui-bg-orange">'+d.STATEb+'</span>';
                            else
                                return '<span class="layui-badge layui-bg-green">'+d.STATEb+'</span>';
                        }}
                    ,{field:'STATEc',  title: '', fixed:'center', sort: true,templet: function(d){
                            switch(d.STATEc){
                                case "弃" :
                                    return '<span class="layui-badge layui-bg-gray" title="已放弃">'+d.STATEc+'</span>';
                                    break;
                                case "未" :
                                    return '<span class="layui-badge layui-bg-orange" title="未完成">'+d.STATEc+'</span>';
                                    break;
                                case "完" :
                                    return '<span class="layui-badge layui-bg-green" title="已完成">'+d.STATEc+'</span>';
                                    break;
                                case "岗" :
                                    return '<span class="layui-badge layui-bg-blue" title="转岗(原岗位:'+d.NJNAME+'")>'+d.STATEc+'</span>';
                                    break;
                                default:break;
                            }
                        }}
                ]]
                ,page: true
                 , done: function () {
                        soulTable.render(this);
                    }
            });

            $("#searchbtn").on('click', () => {
                tableRenders();
            });
    });
    
    function tableRenders() {
        sdat = '${path}/DUserResume/getGxResumeListLayuiJson?flowid=${fid}&'+$('#sform').serialize();
        //执行重载
        GxResumesTable.reload('listTables', {
            url: sdat
            ,method: 'get'
            ,page:  {
                curr: 1 //重新从第 1 页开始
            }
            ,where: {
            }
        }, 'data');
    }
</script>
</body>
</html>